home *** CD-ROM | disk | FTP | other *** search
- /* Amiga port by Tomas Willis (tomas@cae.wisc.edu) January 1995 */
- /* This is my little routine to trick up the AmiTCP uid.
- * Why this isn't a standar funciton, I don't know. I probably
- * missed something in the docs. --tcw
- */
- /* Amiga port by Tomas Willis (tomas@cae.wisc.edu) January 1995 */
-
- #include <pwd.h>
- #include <stdlib.h>
- #include <string.h>
-
- //protos
- unsigned long getuid(void);
-
- unsigned long
- getuid(void)
- {
- struct passwd *pw=NULL;
- char *un=NULL;
- ULONG uid = 1;
-
- un = getenv("USERNAME");
- if (0 != strlen(un)) {
- pw = getpwnam(un);
- if (NULL != pw) {
- uid = pw->pw_uid;
- }
- }
- return(uid);
- }
-
-
-